
#include "SmallMediaLibrary.h"

#include <vcclr.h>
using namespace System;
using namespace Collections;
using namespace Collections::Generic;

namespace SmallMediaLibrary {
		
	public ref class MediaPlayer
	{
	public:
		MediaPlayer();
		~MediaPlayer();

	public:
		virtual void Load(String^ filename);

	protected:
		IGraphBuilder* mGraphBuilder;
		IMediaControl* mMediaControl;
		IMediaSeeking* mMediaSeeking;

		REFERENCE_TIME mDuration;
	
	public:
		virtual void Play();
		virtual void Stop();
		virtual void Pause();
		virtual void Seek(long time_ms);

		virtual property long Duration
		{
			long get()
			{
				return ((mDuration / 10) / 1000); //100ns = 0.1us = 0.0001 ms
			}
		}

	protected:
		virtual void Initialise();
		virtual void Shutdown();
		virtual HRESULT CheckFilterGraphFor(IFilterGraph *pGraph, IBaseFilter* pFilterToLookFor);

		List<String^>^ ErrorLog;
	};


}